package pl.wroc.uni.ii.puzzle.view;

import pl.wroc.uni.ii.puzzle.game.Game;
import android.test.AndroidTestCase;
import android.test.IsolatedContext;
import android.test.mock.MockContentResolver;
import android.view.MotionEvent;

public class GameTest extends AndroidTestCase{

//	private Game game;
//	public final static int SCREEN_WIDTH = 480;
//	public final static int SCREEN_HIGHT = 640;
//	
//	public void setUp() throws Exception{
//		super.setUp();
//		IsolatedContext mockContext = new IsolatedContext(new MockContentResolver(), getContext());
//		game = new Game(mockContext, SCREEN_WIDTH, SCREEN_HIGHT);
//	}
//	
//	public void testShouldSelectCell() {
//		//given
//		int x = 1;
//		int y = 1;
//		int metaState = 0;
//		long downTime = 1;
//		long eventTime = 1;
//		MotionEvent touchEvent = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, x, y, metaState);
//		assertFalse(game.getCellFromCoordinates(x, y).isSelected());
//		
//		//when
//		boolean result = game.onTouchEvent(touchEvent);
//		
//		//then
//		assertTrue(result);
//		assertTrue(game.getCellFromCoordinates(x, y).isSelected());
//	}
//	
//	public void testShouldNotSelectCell() {
//		//given
//		int x = 1;
//		int y = 1;
//		int xInOtherCell = 200;
//		int yInOtherCell = 200;
//		int metaState = 0;
//		long downTime = 1;
//		long eventTime = 1;
//		MotionEvent touchEvent = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, xInOtherCell, yInOtherCell, metaState);
//		assertFalse(game.getCellFromCoordinates(x, y).isSelected());
//		
//		//when
//		boolean result = game.onTouchEvent(touchEvent);
//		
//		//then
//		assertTrue(result);
//		assertFalse(game.getCellFromCoordinates(x, y).isSelected());
//	}
}
